package com.blacktea.creationalpatterns.factorymethod.factory;

import com.blacktea.creationalpatterns.factorymethod.service.UserService;
import com.blacktea.creationalpatterns.factorymethod.service.UserServiceImpl;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: black tea
 * @date: 2023/3/19 1:12
 */
@Component
public class UserServiceFactory implements FactoryBean<UserService> {

    @Override
    public UserService getObject() throws Exception {
        return new UserServiceImpl();
    }

    @Override
    public Class<?> getObjectType() {
        return UserService.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}